package net.qhzw.geologr5.gis.service.system.controller;

import net.qhzw.geologr5.gis.common.framework.utils.JsonResult;
import net.qhzw.geologr5.gis.service.system.entity.ProjectType;
import net.qhzw.geologr5.gis.service.system.query.ProjectTypeQuery;
import net.qhzw.geologr5.gis.service.system.service.ProjectTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/***
 * 项目类别前端控制器
 */

@RestController
@RequestMapping("projectType")
public class ProjectTypeController {

    @Autowired
    private ProjectTypeService projectTypeService;

    /***
     * 查询项目类型
     * @return
     */
    @GetMapping("findAll")
    public JsonResult findAll(ProjectTypeQuery query){
        return projectTypeService.findAll(query);
    }


    /***
     * 创建项目类别
     * @return
     */
    @PostMapping("create")
    public JsonResult create(@RequestBody ProjectTypeQuery query){
        return projectTypeService.create(query);
    }


    /***
     * 删除项目类别
     * @param id
     * @return
     */
    @DeleteMapping("delete/{id}")
    public JsonResult delete(@PathVariable("id") Integer id){
        return projectTypeService.delete(id);
    }


}
